Repository navigation
fix(gateway): degrade when a provider is down - #5
Open
fabianzimber wants to merge 3 commits into
Open
fabianzimber wants to merge 3 commits into
fabianzimber wants to merge 3 commits into
Conversation
A cache miss that times out against FrankerFaceZ or IVR was returned as 502, and the next request during backoff as 503. Serve any copy still held, keep provider 404s as negative cache, and log upstream failures apart from Worker faults. Add /health for a check that does not call a provider. Co-authored-by: Fabian Zimber <[email protected]>
cursor
Bot
force-pushed
the
cursor/gateway-upstream-degrade-3154
branch
from
November 13, 2026 22:55
7a17960 to
9459372
Compare
fabianzimber
commented
Nov 13, 2026
fabianzimber
left a comment
Member
Author
There was a problem hiding this comment.
deployment notes way too large and no proper format. please include also steps regarding access safety for cloudflare one zto if needed regarding health checkpoint from clientside. please also pay more attention to using clean code.
https://labs42io.github.io/clean-code-typescript/#comments
One helper writes Worker log lines. Provider failure reasons are a const, and the 7TV test id prefix is named. Co-authored-by: Fabian Zimber <[email protected]>
Name upstream reasons, log Cloudflare platform failures through one error type, and let the cache path read as early returns. Co-authored-by: Fabian Zimber <[email protected]>
|
Rewrote the description into Summary, Changes, Testing, Deployment notes, and Access / Zero Trust. No Access application is defined in this repo; the Access section says what to add if one is attached later. The degrade path is named functions and constants, without the narrative comments. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GETandHEAD /healthread only the version binding. No KV, hub, or provider call./api/irclogs the shard and a scrubbed cause.Changes
STALEinstead of 502/503.UpstreamReason. Cloudflare platform failures go throughPlatformError, which drops URLs and query strings.upstream_unavailableorhub_unavailable, with no channel id.Testing
pnpm typecheckpnpm exec biome cipnpm test(88 tests)Deployment notes
main. Workers Builds runspnpm run build:cloudflare, thennpx wrangler@4 deploy. No new binding or secret./healthonpetal.shiftbloom.studioandchat.shiftbloom.studio. Expect{ ok: true, version }.Access / Zero Trust
Not needed. This repo does not define a Cloudflare Access application for either hostname.
If an Access application is later attached to
petal.shiftbloom.studioorchat.shiftbloom.studio, it covers/healthwith the rest of that host. Then:/health.CF-Access-Client-IdandCF-Access-Client-Secretfrom the checker.{ ok: true, version }, with no tokens, channel names, or account data.